<me:UIABPOS x:Class="WPFExcelReport.TAB02SYT"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"                    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                     xmlns:MCO="clr-namespace:WPFExcelReport;assembly=TICC_ABPOS_MCO"
                    xmlns:me="clr-namespace:WPFExcelReport"
                    xmlns:MK="clr-namespace:WPFExcelReport;assembly=TICC_MKRF" 
                    xmlns:WW="clr-namespace:WPFExcelReport;assembly=TWBBEW"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIABPOS.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:TIMES100  x:Key="X100"/>
        <ucd:TIMES10  x:Key="X10"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIABPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition> 
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions> 
        <StackPanel Grid.Row="0" Grid.Column="0">
            <StackPanel  >
                <WrapPanel >
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0" Click="PrintCommand" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" 
                                   Text="{Binding Source={Localization:Translate Word=打印}}"></TextBlock>
                    </Grid>
                    <TextBlock   Text="{Binding Source={Localization:Translate Word=生产单}}"/>
                    <TextBox   Text="{Binding KRS,ElementName=TV}" Width="40"/>
                    <TextBox   Text="{Binding LFD,ElementName=TV}" Width="80"/>
                    <TextBox   Text="{Binding POS,ElementName=TV}" Width="80"/>
                    <CheckBox Content="{Binding Source={Localization:Translate Word=已完成}}" IsChecked="{Binding ERLKZ,ElementName=TV}"/>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"   Margin="20,0,0,0" Content="{Binding Source={Localization:Translate Word=导入生产单}}" Click="ImportABPCommand" >
                         </Button> 
                    </Grid>
                </WrapPanel>
                <WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期:}}"/>
                        <TextBox Grid.Column="1" Text="{Binding DTSTART,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"/>
                        <TextBox Grid.Column="1" Text="{Binding DTEND,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=录单:}}"/>
                        <TextBox Grid.Column="1" Text="{Binding NEUDATS,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"/>
                        <TextBox Grid.Column="1" Text="{Binding NEUDATE,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0" Click="QueryCommand" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                </WrapPanel>
                <WrapPanel Grid.Row="0">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=后整下单:}}"></TextBlock>
                    <TextBlock Text="{Binding ABPNEUDAT,Source={StaticResource vwMaster} }"></TextBlock>
                    <TextBlock Margin="10,0,0,0"  Text="{Binding Source={Localization:Translate Word=完成:}}" ></TextBlock>
                    <TextBlock Text="{Binding ABPERLDAT,Source={StaticResource vwMaster} }"></TextBlock>
                </WrapPanel>
            </StackPanel>
        </StackPanel>     
       
        <DataGrid  Grid.Row="1"  
                   Grid.Column="0"
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                    x:Name="dlgMaster"   
                >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD, Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=生产单}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS, Converter={StaticResource pnum}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE1, Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=计划量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=品种}}" Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=ABPFARBE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPBESCHICH, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=后整理}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPEALFM, Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=产量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPERLKZ}" Header="{Binding Source={Localization:Translate Word=完成}}" Width="Auto" />
            </DataGrid.Columns>
        </DataGrid>
        <WrapPanel Grid.Row="2"  >
            <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"/>
            <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"/>
            <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"/> 
        </WrapPanel>
    </Grid>
</me:UIABPOS>
